package ca.ualberta.cs.CLRDB.conference;

import java.sql.SQLException;
import java.sql.Statement;

import ca.ualberta.cs.CLRDB.interfaces.EntityRelManagement;

public class PaperAssignments extends EntityRelManagement{

	@Override
	public void initialize(Statement statement) throws SQLException {
		try{
			statement.executeUpdate("DROP TABLE Assignments");
		}catch(Exception e){}
		
		statement.executeUpdate("CREATE TABLE Assignments ( " +				
				"personId INTEGER NOT NULL, " +				
				"bibtexId INTEGER NOT NULL, " +
				"CONSTRAINT pk_assign PRIMARY KEY(personId,bibtexId), " +				
				"CONSTRAINT FK_bibtexId FOREIGN KEY (bibtexId) " +
        			"REFERENCES BibTex (ID) ON DELETE CASCADE, " +
				"CONSTRAINT FK_personId FOREIGN KEY (personId) " +
            		"REFERENCES Person (ID) ON DELETE CASCADE " +				
				") IN CLRSPACE"); 
		
		numOfCols = 2;				
		
	}

}
